Conventional fragment processing for three-dimensional (3-D) graphics programming application program interfaces (APIs) such as Open Graphics Library (OpenGL®) and Direct3D™ provide support for per-fragment processing (i.e. texture mapping, color sum, fog, etc.). The computations provided by such conventional fragment processing are routinely implemented by 3-D graphics hardware that greatly accelerates these operations.
Unextended OpenGL mandates a certain set of configurable per-fragment computations defining texture lookup, texture environment, color sum, and fog operations. Each of these areas provide a useful but limited set of fixed operations. For example, unextended OpenGL 1.2.1 provides only four texture environment modes, color sum, and three fog modes.
To enable more advanced rendering effects, certain extensions have either improved the functionality or introduced new models of configurability for fragment operations. Texture environment operations have been enhanced by extensions such as NV_register combiners, ARB_texture_env_add, EXT_texture_env_combine, and EXT_texture_env_dot3. NV_texture_shader allows a number of special operations, including dependent texture lookups (where the results of one texture lookup are used to modify or replace texture coordinates used for a second lookup). Similar special-purpose extensions (i.e. NV_fog_distance, EXT fog_coord) have introduced some level of configurability to fog.
Each such extension adds a limited set of special-case modes, and enables a new set of rendering effects. The set of effects enabled, however, is limited by the set of special modes introduced by the extension. This lack of flexibility is in sharp contrast to the high-level of programmability of general-purpose CPUs and other (frequently software-based) shading languages.
There is thus a need for an extension capable of exposing an application writer to an unprecedented degree of programmability in the computation of final fragment colors and depth values.